home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / shadow11.arc / SHDWACES.S < prev   
Text File  |  1988-10-30  |  8KB  |  212 lines

  1. ; shdw_struct();            /* C calling sequence */
  2. ;===========================
  3. ; SHDW_STRUCT
  4. ;===========================
  5. shdw_struct:
  6.     MOVE.W  #$0, -(A7)      ; function number (returns pointer to shdw_rec)
  7.     TRAP    #15             ; D0 contains pointer to structure on return
  8.     ADDQ.L  #2, A7          ; clean up stack
  9.     RTS
  10.  
  11. ; shdw_receive(buffer, length, mode);   /* C calling sequence */
  12. ;===========================
  13. ; SHDW_RECEIVE
  14. ;===========================
  15. shdw_receive:
  16.     MOVE.L  12(A6), -(A7)   ; push length of buffer  (length)
  17.     MOVE.L  8(A6), -(A7)    ; push pointer to buffer (buffer)
  18.     MOVE.W  16(A6), -(A7)   ; push transfer option   (mode)
  19.     MOVE.W  #$1, -(A7)      ; push function number
  20.     TRAP    #15
  21.     ADDA.L  #$c, A7         ; clean up stack
  22.     RTS
  23.  
  24. ; shdw_send(buffer, length, mode);      /* C calling sequence */
  25. ;===========================
  26. ; SHDW_SEND
  27. ;===========================
  28. shdw_send:
  29.     MOVE.L  12(A6), -(A7)   ; push length of file to send (moot for batch)
  30.     MOVE.L  8(A6), -(A7)    ; push pointer to buffer
  31.     MOVE.W  16(A6), -(A7)   ; push transfer option
  32.     MOVE.W  #$2, -(A7)      ; push function number
  33.     TRAP    #15
  34.     ADDA.L  #$c, A7         ; clean up stack
  35.     RTS
  36.  
  37. ; shdw_abort();             /* C calling sequence */
  38. ;===========================
  39. ; SHDW_ABORT
  40. ;===========================
  41. shdw_abort:
  42.     MOVE.W  #$3, -(A7)      ; function number (abort all transfers)
  43.     TRAP    #15
  44.     ADDQ.L  #2, A7          ; clean up stack
  45.     RTS
  46.  
  47. ; shdw_digits();            /* C calling sequence */
  48. ;===========================
  49. ; SHDW_DIGITS
  50. ;===========================
  51. shdw_digits:
  52.     MOVE.W  #$4, -(A7)      ; function number (turn on on-screen count)
  53.     TRAP    #15
  54.     ADDQ.L  #2, A7          ; clean up stack
  55.     RTS
  56.  
  57. ; shdw_nodigits();          /* C calling sequence */
  58. ;===========================
  59. ; SHDW_NODIGITS
  60. ;===========================
  61. shdw_nodigits:
  62.     MOVE.W  #$5, -(A7)      ; function number (turn off on-screen count)
  63.     TRAP    #15
  64.     ADDQ.L  #2, A7          ; clean up stack
  65.     RTS
  66.  
  67. ; shdw_bell();              /* C calling sequence */
  68. ;===========================
  69. ; SHDW_BELL
  70. ;===========================
  71. shdw_bell:
  72.     MOVE.W  #$6, -(A7)      ; function number (turn on completion bell)
  73.     TRAP    #15
  74.     ADDQ.L  #2, A7          ; clean up stack
  75.     RTS
  76.  
  77. ; shdw_nobell();            /* C calling sequence */
  78. ;===========================
  79. ; SHDW_NOBELL
  80. ;===========================
  81. shdw_nobell:
  82.     MOVE.W  #$7, -(A7)      ; function number (turn off completion bell)
  83.     TRAP    #15
  84.     ADDQ.L  #2, A7          ; clean up stack
  85.     RTS
  86.  
  87. ; shdw_init();              /* C calling sequence */
  88. ;===========================
  89. ; SHDW_INIT
  90. ;===========================
  91. shdw_init:
  92.     MOVE.W  #$8, -(A7)      ; function number (call to restart or init)
  93.     TRAP    #15             ; this function is not needed by user!
  94.     ADDQ.L  #2, A7          ; clean up stack
  95.     RTS
  96.  
  97. ; shdw_dial(number, connect, fail1, fail2);     /* C calling sequence */
  98. ;===========================
  99. ; SHDW_DIAL
  100. ;===========================
  101. shdw_dial:                  ; dial a number in background
  102.     MOVE.L  20(A6), -(A7)   ; fail2 string
  103.     MOVE.L  16(A6), -(A7)   ; fail1 string
  104.     MOVE.L  12(A6), -(A7)   ; connect string
  105.     MOVE.L  8(A6), -(A7)    ; number string (pass zero here to abort)
  106.     MOVE.W  #$9, -(A7)      ; function number
  107.     TRAP    #15
  108.     ADDA.L  #$12, A7        ; clean up stack
  109.     RTS
  110.  
  111. ; shdw_check();             /* C calling sequence */
  112. ;===========================
  113. ; SHDW_CHECK
  114. ;===========================
  115. shdw_check:                 ; this function checks for Shadow's presence
  116.     CLR.L   -(A7)           ; must execute this code in
  117.     MOVE.W  #$20, -(A7)     ; Supervisor mode
  118.     TRAP    #1              ; GEMDOS
  119.     ADDQ.L  #6, A7          ; pop stack
  120.  
  121.     CLR.L   D2              ; set to fail status
  122.     MOVEA.L $42e, A0        ; get phys_top
  123.     CMPA.L  #$400000, A0    ; is it 4 meg boundary?
  124.     BEQ.B   nxtck           ; yep, check for NON RESET PROOF mode
  125.     CMPI.W  #$dc, (A0)      ; does phys_top point to #$00DC (magic number)?
  126.     BNE.B   nxtck           ; nope, check for NON RESET PROOF handler
  127.     MOVE.L  #2, D2          ; set status for NON RESET PROOF mode
  128.                             ; shadow clears buffer pointer and length
  129.                             ; automatically when in NON RESET PROOF mode
  130.                             ; with RAMdisk installed
  131.     TST.L   2(A0)           ; is transfer buffer allocated?
  132.     BEQ.B   leave           ; nope, bye
  133.     MOVE.L  #3, D2          ; set status to indicate installed with buffer
  134.                             ; and rez change when in NON RESET PROOF mode
  135.     CMPA.L  16(A0), A0      ; is buffer below phys_top?
  136.     BGT.B   leave           ; yes, must be NON RESET PROOF w/rez change
  137.     MOVE.L  #1, D2          ; RESET PROOF SHADOW is here, return 1
  138.     BRA.B   leave           ;
  139.  
  140. nxtck:
  141.     MOVE.L  $bc, A0         ; get trap #15 vector
  142.     SUBA.L  #22, A0         ; get pointer to start of SHADOW rec
  143.     CMPI.W  #$dc, (A0)      ; is it magic?
  144.     BNE.B   leave           ; nope, nothing installed
  145.     MOVE.L  #3, D2          ; set status to indicate installed with buffer
  146.                             ; and rez change when in NON RESET PROOF mode
  147.     TST.L   2(A0)           ; buffer allocated?
  148.     BEQ.B   leave           ; yes, definitely a rez change
  149.     MOVE.L  #2, D2          ; nope, must be a reset in NON RESET PROOF mode
  150.                             ; and just started or buffer not allocated yet
  151. leave:
  152.     MOVE.L  D0, -(A7)       ; leave supervisor mode
  153.     MOVE.W  #$20, -(A7)
  154.     TRAP    #1
  155.     ADDQ.L  #6, A7
  156.     MOVE.L  D2, D0          ; return status
  157.                             ; 1 = RESET PROOF
  158.                             ; 2 = NON RESET PROOF with no transfer buffer
  159.                             ; 3 = NON RESET PROOF with transfer buffer
  160.     RTS
  161.  
  162. ; shdw_timeout(seconds);    /* C calling sequence */
  163. ;===========================
  164. ; SHDW_TIMEOUT
  165. ;===========================
  166. shdw_timeout:
  167.     MOVE.W 8(A6),-(A7)      ; push time in seconds or -1 for current timeout
  168.     MOVE.W #10,-(A7)        ; peform SHADOW function #10
  169.     TRAP   #15              ; call it
  170.     ADDQ.L #4, A7           ; fix up stack
  171.     RTS                     ; returns current timeout seconds (if passed -1)
  172.                             ; or current timeout multiplied by 60
  173.                             ; if passed positive values
  174.  
  175. ; shdw_version();           /* C calling sequence */
  176. ;===========================
  177. ; SHDW_VERSION
  178. ;===========================
  179. shdw_version:
  180.     MOVE.W #11,-(A7)        ; perform SHADOW function #11
  181.     TRAP   #15              ; call it
  182.     ADDQ.L #2, A7           ; fix up stack
  183.     RTS                     ; returns an integer value equal to the current
  184.                             ; handler version number, ie 110 = v 1.10
  185.                             ; old handlers will return the function # (11)
  186.  
  187. ; shdw_location(x,y);       /* C calling sequence */
  188. ;===========================
  189. ; SHDW_LOCATION
  190. ;===========================
  191. shdw_location:
  192.     MOVE.W  10(A6), -(A7)   ; push y in character coordinates
  193.     MOVE.W  8(A6), -(A7)    ; push x in character coordinates
  194.                             ; or -1 for current location
  195.                             ; x returned in D0, y returned in D1
  196.     MOVE.W  #12, -(A7)      ; function number
  197.     TRAP    #15             ; do it
  198.     ADDQ.L  #6, -(A7)       ; fix up stack
  199.     RTS
  200.  
  201. ; shdw_set_values(length, buffer);  /* C calling sequence */
  202. ;===========================
  203. ; SHDW_SET_VALUES
  204. ;===========================
  205.     MOVE.L  $bc, A0         ; get trap #15 vector
  206.     SUBA.L  #22, A0         ; point to start of SHADOW rec
  207.     MOVE.L  8(A6), 2(A0)    ; store length of transfer buffer
  208.     MOVE.L  12(A6), 16(A0)  ; store pointer to transfer buffer
  209.     RTS                     ; use this call to store info about transfer
  210.